<!DOCTYPE html>
<html>
<head>
    <title>安置</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">安置房源情况统计
        </div>
        <div class="layui-card-body">
            <table class="layui-table" style="text-align: center;">
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" rowspan="2">安置项目</th>
                    <th style="text-align: center;" rowspan="2">幢号</th>
                    <th style="text-align: center;" colspan="2">全部房源</th>
                    <th style="text-align: center;" colspan="3">已选房源</th>
                    <th style="text-align: center;" colspan="3">未选房源</th>
                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;width: 10%">全部房源数量</th>
                    <th style="text-align: center;width: 10%">全部房源面积</th>
                    <th style="text-align: center;width: 10%">房源数量比例</th>
                    <th style="text-align: center;width: 10%">已选房源数量</th>
                    <th style="text-align: center;width: 10%">已选房源面积</th>
                    <th style="text-align: center;width: 10%">房源数量比例</th>
                    <th style="text-align: center;width: 10%">未选房源数量</th>
                    <th style="text-align: center;width: 10%">未选房源面积</th>
                </tr>
            <#list azProjectList as azProject>
                <#assign houseCountMap = (houseMap[azProject.id?c])!/>
                <#assign carLotCountMap = (carLotMap[azProject.id?c])! />
                <#assign storageRoomCountMap= (storageRoomMap[azProject.id?c])!/>
                <#assign rowLenth= houseCountMap?size + 3 />

                <#if houseCountMap?size !=0>
                    <#assign allCountSum = 0/>
                    <#assign chooseCountSum = 0/>
                    <#assign unChooseCountSum = 0/>
                    <#assign allCountSumArea = 0/>
                    <#assign chooseCountSumArea = 0/>
                    <#assign unChooseCountSumArea = 0/>

                    <#list houseCountMap?keys as buildNum>
                        <#assign allCountSum = allCountSum + houseCountMap[buildNum]['allCount'] />
                        <#assign chooseCountSum =  chooseCountSum + houseCountMap[buildNum]['choose']/>
                        <#assign unChooseCountSum = unChooseCountSum + houseCountMap[buildNum]['unChoose']/>
                        <#assign allCountSumArea = allCountSumArea + houseCountMap[buildNum]['allCountArea'] />
                        <#assign chooseCountSumArea =  chooseCountSumArea + houseCountMap[buildNum]['chooseArea']/>
                        <#assign unChooseCountSumArea = unChooseCountSumArea + houseCountMap[buildNum]['unChooseArea']/>

                        <tr>
                            <#if buildNum_index ==0>
                                <td rowspan="${rowLenth}">${(azProject.projectName)!}</td></#if>
                            <td>${buildNum}幢</td>
                            <td>${houseCountMap[buildNum]['allCount']}</td>
                            <td>${houseCountMap[buildNum]['allCountArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(houseCountMap[buildNum]['choose'],houseCountMap[buildNum]['allCount'])}</td>
                            <td>${houseCountMap[buildNum]['choose']}</td>
                            <td>${houseCountMap[buildNum]['chooseArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(houseCountMap[buildNum]['unChoose'],houseCountMap[buildNum]['allCount'])}</td>
                            <td>${houseCountMap[buildNum]['unChoose']}</td>
                            <td>${houseCountMap[buildNum]['unChooseArea']}m²</td>
                        </tr>
                    </#list>

                    <tr>
                        <td><span class="jmdf-color-red jmdf-text-bold">房源总计</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${allCountSum}</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${allCountSumArea}m²</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${bigUtils.getPercentBigDecimal(chooseCountSum,allCountSum)}</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${chooseCountSum}</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${chooseCountSumArea}m²</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${bigUtils.getPercentBigDecimal(unChooseCountSum,allCountSum)}</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${unChooseCountSum}</span></td>
                        <td><span class="jmdf-color-red jmdf-text-bold">${unChooseCountSumArea}m²</span></td>
                    </tr>

                    <tr>
                        <td>车位</td>
                        <#if carLotCountMap?size ==0>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        <#else>
                            <td>${carLotCountMap['allCount']}</td>
                            <td>${carLotCountMap['allCountArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(carLotCountMap['choose'],carLotCountMap['allCount'])}</td>
                            <td>${carLotCountMap['choose']}</td>
                            <td>${carLotCountMap['chooseArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(carLotCountMap['unChoose'],carLotCountMap['allCount'])}</td>
                            <td>${carLotCountMap['unChoose']}</td>
                            <td>${carLotCountMap['unChooseArea']}m²</td>
                        </#if>
                    </tr>

                    <tr>
                        <td>储物间</td>
                        <#if storageRoomCountMap?size ==0>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        <#else>
                            <td>${storageRoomCountMap['allCount']}</td>
                            <td>${storageRoomCountMap['allCountArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(storageRoomCountMap['choose'],storageRoomCountMap['allCount'])}</td>
                            <td>${storageRoomCountMap['choose']}</td>
                            <td>${storageRoomCountMap['chooseArea']}m²</td>
                            <td>${bigUtils.getPercentBigDecimal(storageRoomCountMap['unChoose'],storageRoomCountMap['allCount'])}</td>
                            <td>${storageRoomCountMap['unChoose']}</td>
                            <td>${storageRoomCountMap['unChooseArea']}m²</td>
                        </#if>
                    </tr>
                </#if>
            </#list>
            </table>
        </div>
    </div>
</div>
</body>
</html>